package jzoo;

/**
 *
 *JavaZoo | JZOO
 *@author Rudy Emmanuel Matos Perez
 *@version 1.0
 *@date 08/08/07
 *
 */

import java.util.ArrayList;

public class JZOO{


	public static void main(String [] args){

		//Creating ArrayLists
		ArrayList <ZooKeeper> listKeeper = new ArrayList <ZooKeeper>();
		ArrayList <ZooAnimal> listAnimal = new ArrayList <ZooAnimal>();
		ArrayList <Cage> listCage = new ArrayList <Cage>(); 

		//Creating Objects
		ZooAnimal zAnimal = new ZooAnimal();
		ZooKeeper zKeeper = new ZooKeeper();
		Cage zCage = new Cage();

/*
 *Animal Data
 *Set Name, Type and Color. Age and isHungry values came with the constructor. 
 *Print 2 animal states (eat and sleep)
 */

		zAnimal.setName("Rocky");
		zAnimal.setType("Dog");
		zAnimal.setColor("White");    

		System.out.println("Animal Data"+"\n"+"\n"+"Name: "+listAnimal.get(0).getName()+"\n"+"Type: "+listAnimal.get(0).getType()+"\n"+"Color : "+listAnimal.get(0).getColor()+"\n"+"Age : "+listAnimal.get(0).getAge()+"\n");

/* 
 * Cage Data
 * Set Dimensions of Cage 
 */
		
		System.out.println(listAnimal.get(0).getName()+" Data Cage"+"\n");
		zCage.setDimensions(25,30,8);
		zCage.getCageDimension();   
		
		//Adding Animal , Cage & Keeper to the list
		listAnimal.add(zAnimal);
		listKeeper.add(zKeeper);
		listCage.add(zCage);

		
		//Asign a ZooKeeper to an Animal and one Cage to this Animal
		listKeeper.get(0).setAnimal(listAnimal.get(0));
		listAnimal.get(0).setCage(listCage.get(0));

		//Checking Values of Cage and Animals    
		System.out.println("Is The Cage Dirty?: "+listKeeper.get(0).getAnimal().getCage().getDirty());
		listKeeper.get(0).cleanAnimalCage(listKeeper.get(0).getAnimal().getCage());
		System.out.println("Is The Cage Covered?:"+listKeeper.get(0).getAnimal().getCage().getCovered());
		listKeeper.get(0).unconveredAnimalCage(listKeeper.get(0).getAnimal().getCage());
		System.out.println("Is The Animal Hungry? "+listAnimal.get(0).getHungry());
		listKeeper.get(0).feedAnimal(listKeeper.get(0).getAnimal());
		listAnimal.get(0).sleep();

/*
 * Testing with Other object
 * Creating new object from the same object
 */

		//Creating new Object
		zAnimal = new ZooAnimal();
		zKeeper = new ZooKeeper(); 
		zCage =  new Cage();
		
		//Setting Values
		zAnimal.setName("Jerry");
		zAnimal.setType("Cat");
		zAnimal.setColor("Black");

		//Adding Animal, Cage & Keeper to the list
		listAnimal.add(zAnimal);
		listKeeper.add(zKeeper);
		listCage.add(zCage);
		
		// Data Cage 2nd Object
		System.out.println(listAnimal.get(1).getName()+" Data Cage"+"\n");
		zCage.setDimensions(25, 30, 30);
		zCage.getCageDimension();

		//Asign a ZooKeeper to an Animal and one Cage to this Animal
		listKeeper.get(1).setAnimal(listAnimal.get(1));
		listAnimal.get(1).setCage(listCage.get(1));

		//Checking Values of Cage and Animals 
		System.out.println("Is the Cage Dirty? "+listKeeper.get(1).getAnimal().getCage().getDirty());
		listKeeper.get(1).cleanAnimalCage(listKeeper.get(1).getAnimal().getCage());
		System.out.println("Is the Cage Covered? "+listKeeper.get(1).getAnimal().getCage().getCovered());
		listKeeper.get(1).unconveredAnimalCage(listKeeper.get(1).getAnimal().getCage());
		System.out.println("Is "+listKeeper.get(1).getAnimal().getName()+" Hungry?"+listKeeper.get(1).getAnimal().getHungry());
		listKeeper.get(1).feedAnimal(listKeeper.get(1).getAnimal());
		listAnimal.get(1).sleep();

	}

}